package main

import (
	"github.com/astaxie/beego"
	_ "goWeb/routers"
	"github.com/astaxie/beego/session"
)


var globalSessions *session.Manager
func init()  {
	sessionConfig := &session.ManagerConfig{
		CookieName:"gosessionid",
		EnableSetCookie: true,
		Gclifetime:3600,
		Maxlifetime: 3600,
		Secure: false,
		CookieLifeTime: 3600,
		ProviderConfig: "./tmp",
	}
	globalSessions, _ = session.NewManager("memory",sessionConfig)
	go globalSessions.GC()
}

func main() {
	// 配置静态资源路径
	//beego.SetStaticPath("/static","src/static")
	// 设置日志文件路径
	beego.SetLogger("file", `{"filename":"logs/mes.log"}`)
	// 设置视图文件路径   ** 注意的是views前面 和v后面不要加斜线
	//beego.SetViewsPath("src/views")
	//beego.BConfig.WebConfig.Session.SessionOn = true
	//beego.BConfig.Listen.HTTPPort = 8080
	// 配置模板后缀
	//beego.AddTemplateExt("html")
	//beego.Router("/", &router.MainController{})
	//beego.AutoRouter(&router.MainController{})
	//beego.Include(&router.MainController{})
	beego.Run()
}